package com.heima.zuoye.day07.timu6;

import java.sql.SQLOutput;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Demo1 {
    public static void main(String[] args) {
        System.out.println("请输入一句字符串");
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        Map<Character, Integer> map = new HashMap<>();
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            if (map.containsKey(s.charAt(i))) {
                Integer i1 = map.get(s.charAt(i));
                map.put(s.charAt(i), i1 + 1);
            } else {
                map.put(s.charAt(i), 1);
            }
        }
        System.out.println(map);
    }
}
